<!DOCTYPE html>
<html>

<head>
    <title></title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="../bootstrap-5.1.3-dist/css/bootstrap.css" rel="stylesheet">
    <script src="../bootstrap-5.1.3-dist/js/bootstrap.bundle.js"></script>
</head>

<body class="container">
    <h3 align="center">按钮、链接中添加徽章</h3>
    <button type="button" class="btn btn-primary">
        按钮<span class="badge bg-dark ml-4">1</span>
    </button>
    <button type="button" class="btn btn-danger">
        按钮<span class="badge bg-dark ml-4">2</span>
    </button>
    <button type="button" class="btn btn-success">
        链接<span class="badge bg-dark ml-4">3</span>
    </button>
    <a href="#" class="btn btn-warning">
        链接<span class="badge bg-dark ml-4">4</span>
    </a>
</body>

</html>